WordPress Theme Hacks for Block and Classic Themes
The classic WordPress theme hacks are still the right questions: how do you highlight the current menu item, show different layouts for different content, pull a custom list of posts, attach extra data to a post, or add a page template? What changed is the answer. Most of the PHP you used to paste into header.php and sidebar.php now lives in block templates, theme.json and a handful of core blocks, and a few old functions are outright discouraged.
This guide goes through each classic hack in turn and shows the modern replacement. Where a block theme has no equivalent, or you maintain a classic PHP theme, you get the current PHP approach too. Everything shown for block themes was run on a small demo theme on WordPress 7.1.4 (the version WordPress Playground served as its latest release when this article was written).
Block theme or classic theme: what decides the technique
A block theme has templates/index.html and builds pages out of blocks. You edit it in the Site Editor, and layout, colors and typography live in theme.json. A classic theme uses PHP template files such as single.php and edits layout in code. Both are fully supported, and both follow the same template hierarchy, so the file names carry over; only the extension and the way you write the content change.
The rule of thumb used below: reach for a block or a theme.json setting first, drop to PHP only when markup alone cannot do the job. The official template documentation is the reference for file names.
| Old hack | Modern replacement |
|---|---|
is_page() to mark the current menu item |
Navigation block (adds aria-current) or wp_nav_menu() classes |
Conditional <title> in header.php |
Theme title support, filtered with document_title_parts |
is_home() includes |
front-page.html template or is_front_page() |
in_category() to add a CSS class |
Classes already printed by post_class() and the Post Template block |
single1.php includes by category ID |
Template hierarchy with slug-based file names |
query_posts() |
Query Loop block, pre_get_posts, WP_Query |
| Custom fields echoed in the loop | Registered post meta with Block Bindings, or featured images |
wp_list_pages() |
Page List block or wp_list_pages() |
Template Name: comment |
customTemplates in theme.json |
Highlight the current menu item
The old trick tested the request with is_page('about') and echoed class="current" by hand. You no longer need any of that. Menus built with the Navigation block mark the link for the page you are on with aria-current="page", which is the accessible signal screen readers use, and you style that attribute directly.
.wp-block-navigation [aria-current="page"] {
font-weight: 700;
text-decoration: underline;
text-underline-offset: 0.4em;
}
Put that in the styles.css field of theme.json (or in a stylesheet you enqueue). A block theme’s style.css is not loaded on the front end for you (the demo’s page source has no link to it), which trips up almost everyone coming from classic themes. If you prefer a stylesheet, enqueue it yourself with wp_enqueue_style( 'my-theme', get_theme_file_uri( 'style.css' ) ) on wp_enqueue_scripts, or load per-block files with wp_enqueue_block_style() (since 5.9), which loads each file only when its block renders. In a classic theme, wp_nav_menu() still prints current-menu-item and current-menu-ancestor classes, so the same CSS idea applies with those selectors.

aria-current, with no conditional PHP.If you do need a custom menu in markup, the same rule keeps it accessible. Our responsive navbar with dropdown and call to action is a ready-made layout to start from.
Set the page title properly
Hand-built <title> tags with a chain of elseif branches belong to the past, and so does wp_title(). The documentation says theme title support should be used in place of wp_title(). In a classic theme, register it once, before wp_loaded, and delete the <title> tag from header.php:
add_action( 'after_setup_theme', function () {
add_theme_support( 'title-tag' );
} );
Block themes need no setup. The demo theme above never calls it, yet its pages come out as “About – Demo Journal” and “Designing with fluid type – Demo Journal”. To change the pattern, filter the parts instead of rebuilding the string:
add_filter( 'document_title_parts', function ( $parts ) {
if ( is_search() ) {
$parts['title'] = 'Search results';
}
return $parts;
} );
Read the add_theme_support() reference for the timing rule. If you use an SEO plugin, let it own the title and leave this alone.
Show something only on the front page
The old is_home() include had a trap that has not gone away: is_home() means the blog posts index, which is not always the front page. If you set a static homepage under Settings, Reading, the two are different pages.
Do not branch at all. Create a front-page.html template (or front-page.php in a classic theme). The hierarchy checks it first for the site’s homepage, whether it shows posts or a static page, and it overrides home. Anything that should appear only there, such as a hero or a featured strip, goes in that file. If you really must branch inside a shared template, use is_front_page(), not is_home().
Highlight posts in a category
You do not have to test in_category('2') for this. post_class() already prints a class for every category slug on the post, and the Post Template block outputs the same classes. In the demo, a post in the Featured category carries category-featured, so one CSS rule is all it takes:
.wp-block-post.category-featured {
border-left: 4px solid var(--wp--preset--color--accent);
padding-left: 1rem;
}

Slugs are better than IDs. A slug survives an export, an import and a staging copy, while category ID 2 on your laptop is not category ID 2 on the live site. In a classic loop, call post_class() on the article tag and style the same selector.
Different templates for different content
The old “if in category 1 include single1.php” code reimplemented something WordPress does itself. The template hierarchy picks the most specific file that exists, so you only create the files:
single-{post-type}-{slug}.html, thensingle-{post-type}.html, thensingle.htmlfor individual posts.category-{slug}.html, thencategory-{id}.html, thencategory.html, thenarchive.htmlfor category listings.page-{slug}.html, thenpage-{id}.html, thenpage.htmlfor pages.

/category/featured/, and how a customTemplates entry appears as a choice in the page sidebar.So a templates/category-featured.html restyles only that archive, with nothing to wire up. In a classic theme the same names end in .php. Create the template once in the Site Editor, or as a file in /templates. Note that a template saved in the editor lives in the database and overrides the theme file of the same name.
For repeated chunks such as the header and footer, use template parts in the /parts folder, included with the Template Part block. Registering them under templateParts in theme.json gives them readable titles and groups them by area in the editor; see the template parts documentation.
Custom page templates
The Template Name: comment is still valid in classic themes, and a Template Post Type: line extends it beyond pages: for example Template Post Type: post, event makes the template selectable on those types, including custom post types, from WordPress 4.7. In a block theme you register the template in theme.json and add a file with the same name to /templates:
{
"version": 3,
"customTemplates": [
{ "name": "portfolio", "title": "Portfolio", "postTypes": [ "page" ] }
]
}
name is the file name without extension (here templates/portfolio.html), title is what editors see, and postTypes lists where the template can be used, defaulting to pages. Editors then pick it under the Template setting in the page sidebar. The demo’s “Work” page uses it to put a three-column post grid under the page content.

See the custom templates reference for the full field list.
Query posts the modern way
The biggest change is here. query_posts() replaces the main query, which means WordPress runs its default query, throws the result away and runs a second one. The documentation says it is not intended for themes or plugins, warns that it can slow pages, and notes it breaks pagination unless you set paged yourself. Do not use it. You have three better options, depending on what you are changing.
- Any list of posts on a page (block themes): add a Query Loop block. Pick the post type, category, order and count in the sidebar, and use the Post Template, Post Title and Post Featured Image blocks inside it. This replaces the “latest five posts” and “five featured posts” hacks without code.
- Change the main query: hook
pre_get_postsand edit the query before it runs. Always checkis_main_query()and that you are not in the admin. - A secondary list in PHP: use
WP_Queryand reset afterwards.
Excluding a category from the blog index used to be query_posts('cat=-2'). Now:
add_action( 'pre_get_posts', function ( WP_Query $query ) {
if ( is_admin() || ! $query->is_main_query() ) {
return;
}
if ( $query->is_home() ) {
$query->set( 'category__not_in', array( get_cat_ID( 'Featured' ) ) );
}
} );
And a sidebar list of the five latest posts in a category, as a secondary query:
$latest = new WP_Query( array(
'posts_per_page' => 5,
'category_name' => 'featured',
'ignore_sticky_posts' => true,
'no_found_rows' => true,
) );
if ( $latest->have_posts() ) : ?>
<ul>
<?php while ( $latest->have_posts() ) : $latest->the_post(); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
<?php endif;
wp_reset_postdata();
no_found_rows skips the pagination count when you do not paginate, a cheap speed-up. Note that showposts is long gone; the parameter is posts_per_page. When a template’s Query Loop should follow the page’s own query (archives, search), leave its inherit option on, which is what the demo’s templates do.
For more everyday snippets of this kind, our collection of WordPress recipes covers related ground, though read its code with this article’s caveats in mind.
Custom fields, block bindings and featured images
The original use case, an “article image” custom field printed in the loop, is now just the featured image. Use the Post Featured Image block or the_post_thumbnail(); you get responsive srcset, cropping and alt text from the media library for free.
Other extra data (a source link, a rating, a price) still belongs in post meta. Register the key so the editor can read it, then show it with Block Bindings, available from WordPress 6.5 (the API itself; the list of supported blocks has grown since). The binding connects a block attribute to a meta field with no PHP in the template:
add_action( 'init', function () {
register_post_meta( 'post', 'source_url', array(
'type' => 'string',
'single' => true,
'show_in_rest' => true,
'sanitize_callback' => 'esc_url_raw',
) );
} );
<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"core/post-meta","args":{"key":"source_url"}}}}} -->
<p>No source</p>
<!-- /wp:paragraph -->
The text saved in the paragraph is only a placeholder for the editor. On the front end the bound value replaces it, and in a test on WordPress 7.1.4 a post with no value for the key rendered an empty paragraph, not “No source”. Core only skips a binding when the source returns null, and an unset meta key returns an empty string. Hide the empty case in CSS with .source-line:empty { display: none; }, or leave the label out of the markup. The key must be registered with show_in_rest enabled, and keys that start with an underscore are protected and cannot be bound. Bindings work on a short list of attributes. In WordPress 7.1 core lists paragraph, heading and list item content, image fields, button fields, post date datetime, and navigation link and submenu url. The reference does not say which release added each block, so check the Block Bindings documentation for the current list. Also see register_post_meta().

Escape on output in classic code. The old echo $image; from get_post_meta() is an injection risk; wrap it in esc_url() or esc_html() as appropriate.
List pages, build a sitemap and a subpage menu
In a block theme, the Page List block outputs your pages as a list, and inside a Navigation block it is the default way to link them. It has a parent-page setting, which covers the old “subpage menu” case. In PHP, wp_list_pages() still works exactly as before, with arrays instead of query strings:
$children = wp_list_pages( array(
'title_li' => '',
'child_of' => get_the_ID(),
'echo' => 0,
) );
if ( $children ) {
echo '<ul>' . $children . '</ul>';
}
The old string form 'title_li=' is now an array of arguments, which is clearer and safer.
The “sitemap page” hack is mostly unnecessary. Since WordPress 5.5, core publishes an XML sitemap index at /wp-sitemap.xml covering public post types, taxonomies, author archives and the homepage, and references it in robots.txt. To keep one page out of it, filter wp_sitemaps_posts_query_args; see the core announcement. A visitor-facing HTML sitemap is still useful, and the loop above builds one.
Reading, permalink and category settings
The “Admin > Options” screens are now under Settings. The three that matter for a theme:
- Settings, Reading: choose “A static page” for the homepage and a separate page for the posts index. The front page template applies to the homepage in either case.
- Settings, Permalinks: the options include Plain, Day and name, Month and name, Numeric, Post name, and a custom structure. Post name, like
/sample-post/, is the clean default for most sites. A structure with%category%works, but the URL changes whenever you recategorize a post, so be sure that is what you want. - Category base and tag base sit under “Optional” on the same screen. Entering
/topics/turns category URLs into/topics/uncategorized/.
Permalinks work only if your server rewrites URLs. If pretty links 404 after a change, saving the Permalinks screen flushes the rewrite rules. The Permalinks screen documentation covers the details. Change a live site’s structure only with redirects in place.
Try it locally before touching a live site
Every example here is safe to test without a hosting account. wp-env runs WordPress in Docker from your theme directory (wp-env start, then open localhost:8888 with user admin), and our walkthrough on installing WordPress locally covers the classic options. For a quick throwaway site, WordPress Playground’s command line can mount a theme folder and a Blueprint file, which is how the demo screenshots here were produced.
Two habits will save you trouble. Put your changes in a child theme or your own theme rather than editing a theme that receives updates, and move content between environments with the export tools described in exporting and importing WordPress.
Where to go next
If you are starting a theme from scratch, begin with building a custom WordPress theme and the complete theme guide, then come back here for each feature as you need it. The pattern in every section is the same: check whether a block, a template file name or a theme.json setting already does the job, and write PHP only for what is left.
That’s a cool tutorial! I started to setup a new homepage with WordPress only a few hours ago and your tips are coming just at the right moment. Thanks!
An excellent tutorial! Would you mind if I translated it into Chinese on my blog? Of course I will give the original URL. Thank you very much.
It’s a shame that I am not using WordPress anymore. :-( But thanks anyway, this was the kind of tutorial that I was missing when I started using WordPress. May it be of help to many newbies like me.
i’m starting my wordpress website and this is very useful !
i have been watching you guys for few days now , u are the best really :)
Hi Nick!
Very good tipps, thanks for them! I’ve found an another genius simple tipp at
A question:
Your HTML/PHP snippets look pretty good. How do you generate the code: do you type span tags and CSS classes into the code or do you use a wp-plugin or similar?
with best regards
Leo
Great post!
BTW, one thing I don’t like about custom fields is that is so dificult to include them into feeds (for me, a non-developer like you). If you find a solution… please let us know!
;-)
Another very useful tutorial for WordPress by Nick. Great job man. Thanks for sharing it.
I work for a University, and we use it as a “poor man’s CMS”. So far, we haven’t found any challenge we can’t find a solution for somewhere since there are so many plugins and extensions available. I didn’t know any PHP when I started using WordPress but have since been able to cut/paste/alter to do some very crazy things!
A few of our sites running on WP:
https://commencement.syracuse.edu/
(in development)
Interesting article, and nice site. I like the design. I totally agree that WordPress can be used to produce Content Management System. But in order to build more complicated web site I would recommend Joomla as a CMS.
Ive been looking to get into wordpress but have been put off by the backend stuff. Hope this will be the start of great things to come. Will let you know how I get on, thanks
Wow thats good. When I started reading this post I thought “bet I already know this stuff” as I have been using WordPress for years. But I must say there are a few things in there that are totally new to me. Thanks a lot.
This is a very nice post. I’ve been working on WordPress themes and when I’m making mine I have to have multiple WordPress codex windows open so I can look up features. Now that it’s all listed on one page, it will be a lot easier and faster to make WordPress themes.
That is the most useful article ever written about wordpress themes!!! Thanks, Nick!!!!
Nice guide and update, Nick! Oh and btw, bestwebgallery.com has a problem :s Don’t know if you know about it or not.
:)
Really brilliant, thanks. Wish this had been posted about two weeks ago when I had to dig and find a lot of this out without any good resource for it!
Still, plenty of stuff I haven’t used yet here!
Hey, I just created a wordpress website myself! This is such a great resource! My only question, I would really love to know how you created the buttons on your right hand toolbar that navigates you to a different page with all the posts on a certain category… if you could explain that I would be eternally in your debt!
Great site, some nice eye candy and yet very simple. I will spend some time on this page to learn from these nice tutorials.
Thanks for everything, keep on the good job.
Wow there is some great tips here! I’m definately going to use this to test the new conditional testing plugin: WhatIsThis
Thanks for all the hacks!
Great Post!
I will need that to create my personal theme.
:P
Looks excellent. I have a blog set up aside for an official NeoHide Site, which I won’t reveal at the moment, but I am intending to bang on using WordPress as a CMS. Hopefully what you tips have mentioned here is going to help a great deal. Cheers!
Might I suggest this library I use quite every time I need some more juice for my wordpress templates?
WordPress Portal library/plugin:
I’ve developed it with a few friends when we were working on a corporate website based upon WP. After that, we polished the code and upgraded it. :)
Thanks for those tips, I use WordPress quite a bit but some of these are new to me which is good as you may have answered a problem I have and been wanting to solve for one of my websites, so thanks a lot for that :D
There is a better way to highlight an active tab. Instead of putting the ‘current’ class on the tab itself put an id in the body tag to represent the page you are on eg: body id=”contact” then put an id on each tab eg:=”tabhome”, ” id=”tabcontact”. Now the tabs can be highlighted purely by CSS eg: #contact #tabcontact {font-weight:blod}. This requires much less code because there is only one dynamic part in php (the body tag id). See an example in action on my art gallery website.
WordPress is a great CMS with full of customization, i like your clean and simple tutorial.
Great, great article! In fact, i’m designing my own theme for the first time as we speak. This information will become very useful! =) For example, i have never thought about custom fields and never cared about it, but now i can see how i can use it to make some things easier to do. Thank you!
Hi, I’m your reader since april of this year and I like your design and articles. I’m a young italian student’s of InformationTechnology and I want to go to the University (in the specify at “Belle Arti” (Beautiful Arts :-P) in Venice or Milan). I simply love this tutz because I’ll create a site (not weblog) with WP.
You’re a monster :-D Thank you!!
Matt
ps: i’m sorry for the bad english but….i’m a little school’s speaker (lol)
This is a great article. Thank you! Well worth the digg. Keep up the awesome work.
Nice! I can really use this for the theme I’m designing. Thanks for the writeup. :)
Thank you so much – this is a great article. I’ve used WP for ages, but never to this level. Now I am redesigning my site and this is going to be so helpful for implementation!
Nice tips! Congratulations!
A little people know that is possible to use .htm, .html or other extensions in permalinks structure.
Just add the extension to the end of the permalink structure field: /%category%/%postname%.htm or /%category%/%postname%.htm
Excellent tips! We’re redesigning our site around WordPress as well, and these help loads.
Great post! This website design it’s a good example how to use wordpress with very pretty and functional template. Thank you!
Oh god. Looking at your site makes me so upset with my own. I really do like the design here. Its wonderfully made and so influential. I would love to catch some more of these hints and tips. They are very useful.
Continuing to be jealous of yours skills,
Nathan
I consider myself pretty well versed with WordPress hacking, so you can imagine how dumb you made me feel by suggesting that I use a category for featured posts. I felt like a complete moron. So simple, so good.
This is a fantastic article, and I’ve started using a lot of the stuff on here! Very informative, my only question I have, and maybe some of the other readers here might be able to help, is that on this website the categories are displayed as buttons with javascript hover over enabled… how do you do that! I’d really love to know.
All my hack are summarized in just one:
00.gif
Awesome post! Some I already knew of, and some I never thought of! ^^
I just wish I could figure out how to get the “Page Template” tab back in the admin. It’s no longer there :(
Definitely some great stuff there. I’ve had to go to great lengths to find alternatives, when the answers were right in your head!
What took you so long?
:D
Thanks!!
Oh, well done – a very nice list of code stubs all put together.
Bookmarked, because I hate trawling the codex :)
is the google ad can be post after 2nd post?
Hi Nick,
I have a question, I’m working on a blog right now, I noticed yours does the same thing, Try submitting a comment without entering any values. It takes you to wp-comments-post.php its in the includes folder. I guess we should not worry too much about anyone not submitting a comment, but the page it takes you to is a wordpress default page. No longer do we feel like we are in the site. I might try to mess around with it and customize it, like you would a 404 page. but I’m not sure how wordpress will take it. Anyone have thoughts on this?
Thank you so much for this article! I’m setting up my own WordPress blog and this will help me a lot. Like we sa in french “ça tombe à pic”! By the way, I’d like to tell you that this blog is the best ever in terms of design and css. This is a brilliant work you did, so many people can confirm. Have a nice sunday!
I think you need to understand a bit of PHP to do these hacks.. still they are easy and great, thanks for sharing..
@ Matt [60]
Surely you could just use javascript OnSubmit to check if fields are empty and then only submit the form if the fields have been filled out.
I have designed my template in html on my PC and I’m offline (I need to go to a cybercafe to use the internet). I also downloaded the WordPress installation. What do I do next?
Thanx
awesome, just awesome. thanks so much for this post! ;)
I don’t believe you mentioned how to do this, but if you did then I’m so clueless that I completely overlooked it and didn’t realize that that’s what you were doing.
Basically, I want to know if anyone can send me on my way to figuring out how exactly to style different categories separately on the WordPress home page (index). For example, I want a “Links” category, and when I post in that category it isn’t styled like a real post (large heading, etc.).
If you’re unsure as to what exactly it is that I’m talking about, then here’s a few sites that utilize this technique:
https://kottke.org/
These are just a few that I thought of off the top of my head and I’m aware that they don’t all use WordPress. But you get the idea of what I’m wanting.
Thanks in advance!
Hey Casey M.,
Look at the section “Feature post highlighting” above in the article. That is what you would want to do. Inside of your Loop you would want to put that php code in the class position of your div that surrounds each post.
You could even do:
Then you could have seperate styles for .link and .normal
Awesome article. Learned a few things with wordpress I’ve been wanting to, so this helps a lot.
Thanks!!!!
@ Tom [63]
Thanks, Tom your right about that. I didn’t think about that at the time.
Outstanding hints for such a great ‘CMS’ like WordPress is!
Thanks a lot!
dig this stuff always. Would love to know how I can make a wordpress & flash portfolio. Just getting the php to spit out the XML so i can make a flash CMS.
check out http://www.gotoandlearn.com
Great article – it is interesting to look at WordPress as an alternative to other open source or in-house content mangement systems. Many thanks for another great article!
Great sharing. I have Learned a new things with wordpress from the above article. Thanks for the sharing.
Get more with your wordpress , Seo out the box and better seo enable with simple modification.
somebody’s probably already said this, bu i can’t be arsed to page through all the pages of comments.
rather than using a conditional to define a different template for a specific category, let wordpress do the heavy lifting: create a template called category-6.php (or whatever your category ID is), and customize it as you please. wordpress already automatically checks for this, and will use the file if it exists.
Wow! Great article. This has helped me a lot. Keep the good work going on and Thanks a lot :)
Thanks for the article and even more so for the great design. This site’s theme is fantastic. Inspires me to sit down and create a unique one myself. Very Nice.
and one more thing, can i ask some question, actually Im new to the wordpress thing/web. For the widger/sidebar, can change the widget or totally add new thing/function inside? I planning to using WordPress to making my site because i need the Posting/commenting function…..
What would this ( ) be for a Single post?
very good, i like it, just a small question.
i have may pages on my website, they show in the page widget and in the header wich is normal but how can i remove some of the pages from the header but keep them in the page widget? the reason for this is if i goto my website in firefox it looks wrong and this is ecouse of the amount of pages in the header
Brilliant information ! Thanks for putting that together…
Would each WP Theme be appropriate for theses hacks ?
Theme Very good and very good handbook. Thanks !!
Great examples. I did notice that the code for “Unique Single template” has a few issues.
For one, the spacing between the dash and brackets needs closing here:
$wp_query- >post;Same with the space between the bracket and question mark:
? >Otherwise, it throws an error.
Beautiful information. This format is much easier to get an idea of how flexible the template system is in wordpress than the documentation that wordpress offers. Thanks for the hard work in putting this together!
hello! :) that logo with heart on the W of WordPress was originally a creation of mine. I would like to be recognized for that, even if changed and 3d-ed. thanks a lot. I will apreciate this a lot. Thanks again for reading this comment. If you go back in the past wordpress logo competition, you’ll see the logo with the heart was created by me: dandyna, now Betty Carbuncle on the net. Huge hugs, Betty (dandyna)
Thank you for this examples!
I often looked for something like the Dynamic Highlight Menu!
Now i found that! Great
Awesome website and awesome content. I’m a very big wordpress guy but still love to have links like this ready in case. Thanks for the good work!!
Really want to thank you for this post, it has really pulled me through when I was helping a friend to customize this wordpress look. Appreciate your hardwork, putting all these info together!
I’m trying to use it. Just timely for me as I am trying to construct another new website. Stumbled and reviewed!
thank you. this art theme is very good!
Here’s a related question: I want to show content only on a page and all it’s subpages. Is there a way to do that?
the note “don’t spam” should be answered with a installation of askimet. forex and co. … stupid suckers. :-/
Thanks for the WordPress Hacks. I’m going to implements some of these in my SEO website soon.
Just fyi, I think that the is_home() template tag do not work anymore for WP>2.1, due to the new homepage option feature in the admin. Nethertheless you can use a plugin called is_frontpage () that will do the same job…
Congratulation 4 your blog design, I think it is the best I have ever seen.
Haha…. wordpress is very cool indeed. Gonna make use of the custom field now. So great.
I know this is dumb. But I am new to the WordPress thing. Which PHP file do these hacks go?
@Todd Christensen:
These go to the ‘theme’ files.
You can download a theme from online and figure out how they work and then edit according to what you want from there. There is no ‘right’ php file these codes go into because template files are pretty much dynamic in nature. Hope that helps.
Im really getting into wordpress, But your post still blows my mind! lol All the sites you have created are a real inspirations to me. The artwork is not a problem and I really want to push my blog beyond, hopefully soon I will get my head around the customisation of wordpress.
Thanks for the post and thanks for the inspiration
Mali
Eating Design
I just come to say thanks. With your introduction in section “Query Post”, I have solved my theme Problem in a simple and elegant way. :)
I’m trying to set up a Unique Single template… and I keeping getting a blank page… I modified the code like this:
post;
if ( in_category(‘1’) ) {
include(TEMPLATEPATH . ‘/category-1.php’);
}
? >
but, perhaps I’m not putting this in the correct place for the single.php? Where on the file does that need to be inserted? Why does this have a forward slash in the front (/category-1.php) ?
Thanks!
Hi Nick! Thanks for a great website and insight into WordPress.
Im trying to implement the custom hack on my site to produce a Post icon at the top of my posts…im having some trouble aligning it. Help anyone ?
Which of these WP items would you advise for SEO purposes?
Found this post on WP Theme Hacks from our Web Hosting Company using Stumble! Very nice guide.
I really good example of the strange things you can accomplish with wordpress is http://www.webunload.com. It is transformed into a marketplace similar to sitepoint. Enjoyed the article!
I am using the Dynamic Highlight Menu. The problem is, on some pages, there are sub-pages. When I go to those sub-pages, the selected tab at the top isn’t selected anymore. For instance, if I click on the tab Gallery, there are links in the sidebar to say Colored Pencils or Paint. If I click on one of those links, the tab Gallery is no longer highlighted. Would I have to use an or statement to connect all the sub-pages to the main page, or is there an easier way to deal with this situation?
Also, could you email me with your reply? Thanks.
Thanks for the useful tips :)
I created the “Simple CMS WordPress Plugin” recently which massively simplifies the admin panel to make it idiot proof for non web designers to update their simple static websites.
I also have a development theme called “Simple CMS Theme” for helping web designers develop static websites with WordPress.
I really like this blog: the design, the info everything! If this isn’t too much to ask can you please make a detailed tutrial on how to create wordpress themes/templates?(or you can wirte a list of links with very good tuts on same.)
Thanx a million!
well done on this site, it’s really well done! Top tips on how to use wordpress too, very impressed. Will definately come back to check on it. Cheers!
Great post! We have used some of these in our own web design blog, there are a few we have not seen before which we will use in our web hosting blog.
We keep coming back to your site, not just because of the great posts, but the design is just awesome! Keep it up.
very good example..but i’m still confused. can you teach me step by step?
thanks before for your attention..
Hey, great article! I have WordPress installed locally in my computer. And when I try and change the permalinks according to your article, like this:
/%category%/%postname%/
It won’t work…Is this because I’m working with wordpress locally or what?
Hey,
I love your page, i love all the funky colors and the lines kind of like lined paperm and i expecially love your buttons and tabs, im not that great on the computer and dont understand the codes so i was wondering if you ever get extra time maybe you could email me and explain it to ma a little better. Thanks for your time.
Megan
The design of this site is just so cool, man…I love it
@Antonio (comment 178): This is occuring because you havent modified your .htaccess file or ur mod_rewrite isn’t running
This article was really helpful. I’m wondering if there’s a way to tinker around with a WordPress theme without having to do it ‘live’ online. PS your site’s design is amazing!
very good example..but i’m still confused. can you teach me step by step?
thanks before for your attention ..
Hi Nick,
I love your Artwork. Really great job. I’m actually working on a theme, based on your Glossy Theme. If you’re interessted and want to have a look, just mail me.
Kind regards.
hello, your theme so beatifull..natural..i like it..first thing i have to say is iam newbie on wordpress..just 3 days..i learn a little bit about this en that..then WOW wordpress so great..so open source..so freely..alot of source i can got for free..
By the way thanks for you article..help me better..
Oh my gosh am I glad to have found you! I do hope you’ll be able to help me… I think I did something funky to my template when I removed the blog title, and now my About and Home tabs are not where they should be. Please could you take a peek? I’d love you forever! Thank You x
btw – your theme is just beautiful!
Thanks for some great pointers! You’ve just saved me loads of time!
Your layout is just lovely. Easy on the eye and makes technical content easy to navigate and follow. Thumbs up from a technical writer!
Will you creating a theme for us to practice with or a psd version of a theme?
This has been so helpful! I’ve admired your website and its wonderfully homemade design for months now.
I’ve finally gotten my act together and put together a blog, and I’m definitely finding value in your tutorials even more now that I can actually try them out. Keep up the great work!
Thanks so much for the dynamic title tag hack!
I’m using custom fields to display image headers for each page. I’ve been searching for a way how to do this for a while.
I do have an addition to your code for displaying different image banners for each page. I changed it a little to suit the image tag but can’t post it here due to restrictions. I’d love to send it your way to add to the list–it may come in handy for others. I, like yourself, am a designer who’s been picking apart, hacking, and building up code of wordpress.
It is very difficult to chose the best of them (the hacks) as all of them are very helpful and there is not redundancy, but I liked especially one, the Dynamic Highlight Menu. I find it very very designingly helpful.
Thanks for the inspiring and thoughtful post ….i will implement it also on my web..;)
ello i use this code to include pages per id in the template:
`post_content; ?>`
>>>> $my_id = 3; <<<<< is the page ID,
now i am searching a way to include pages in pages
Ultimate article that excels through simplicity, this sort of article i am looking for to leverage my work process, so here i really come to know, that very designer is responsible for SEO services, every designer have to take peer on web page design from page layout to W3C coding standard.
Thank You so Much for this info. So helpful. But where do i carry these out? in the sytlesheet.css, layout.css or where? Need your urgent reply. Thanks.
Cool stuff. but where do i make changes. in the css or the index.php? where exactly? thanks
Great blog, This is one reason to use WordPress, you can use fine hacks!
Regarding:
“Exclude specific category
You can also use query_posts to exclude specific category being displayed. The following code will exclude all posts in categoryID 2 (note: there is a minus sign before the ID number)”
Which php page needs to be edited to include this? I tried the Single.php and Main index.php without any success in actually excluding certain categories.
Nice hack, thanks… Currently i’m building a wordpress theme, these tips helps me a lot.
any idea to put adsense inside the single post page, also to get it surrounded by the nearby text!
Here we have designed plethora of websites & having a huge customized web designed portfolio. But right now we are lagging behind from client list.
Why & how my competitors are fetching my clients.
Wow.. it just like take a good class :) Thanks!!
Thanks for the lessons on WP!
And I love this theme. I wish it were avaible for downloading.
buy gold
We sell wholesale and retail MEDIUM nuggets in not less than 2 ounce lots.
WHOLESALE price for medium nuggets – from 3.1 grams – 31.1 grams (one ounce) are “Spot” Gold Price – that is – the rate for gold on the New York Stock Exchange + 25% + postage and insurance if required..
NOTE: This price takes into account currency fluctuations – bank charges for foreign exchange etc.
RETAIL price for small nuggets – that are from 0.5 grams – 3.0 grams are “Spot” Gold Price – that is – the rate for gold on the New York Stock Exchange + 30% + postage and insurance.
NOTE: This price takes into account currency fluctuations – bank charges for foreign exchange etc.
JEWELLERY quality nuggets are rarer and are negotiated by private treaty.
If over 10 ounces is ordered – a discounted rate will be negotiated.We have access to large supplies of gold.
We are actively seeking more retail outlets that we can supply on a wholesale basis.
GOLD BULLION SELL PRICE 1kg – 500 kg 2nd nigeria Fix +
US$50.00 per kg Monthly Lots by Negotiation 1 – 10 Tons Price 2nd nigeria Fix +
US$25,0000 per ton. Monthly Lots by Negotiation FPRIVATE “TYPE=PICT;ALT=*” 400 Tons
GLD from LBMA member Price 2nd nigeria Fix +
US$25,000 per ton
Special Off
GOLD BULLION BUY PRICE 1 – 5 tons Gold price – 1.75% 10 Ton lots Gold price – 1
.
CONTACTS US REGARDS.
1000,OBAFEMI AWOLOWO WAY
PO Box 2001
ikeja
Nigeria
Creating a wordpress theme from scratch would be great.Starting from a design and going on the coding part of if.
Thanks
Hiya, Great page – thanks for all of the useful information. I was wondering if you could help me with the code for displaying entire posts instead of just the title. What do I need to add to the ‘Diplay Recent Posts’ code above to accomplish this?
Thanks in advance!
Hi,
I have worked on many Joomla templates, but no idea about wordpress templates.
Thx for the tutorial.
Anyway, could you please give us more tutorial!!!
and where can I get WordPress CMS Installer???
Thx
Hey all,
this is such a great resource to up and coming wordpress’ers. Im currently workin on my first wordpress site/blog/theme and was wondering if anyone could let me know how you go about getting the little ‘date’ tabs that appear next to all the articles floating outside the container? forgive me if this seems off topic but i wasnt sure where else to put it.
Cheers
Sorry, find and delete: php the_time(‘Y-m-d\TH:i:sO’); in index.php
Thanks a lot for the Great tutorials.. It is very simple and easy to understand even for a newbie like me :) U really rock and ur design-sense rock more than u do!
One more good reason to use WP.. Ever! Tanks
@Finan Akbar
I get mine as a one-click install from my hosting company (DreamHost).
where do I paste this?
Dynamic Content
If you want to include a file that will only appear on the frontpage, here is the code:
Thank you soooo much for sharing these tips, they help a ton! I Subscribed halfway reading this post, haha.
Btw, love your layout, it’s awesome! Have a good one :D
this is a very nice tutorial on wordpress theme hacks, thanks for this
Thanks for your post so much interesting and very useful. I appreciate your “dynamic title tag” hack which seems to be a respond to override “common title tag mistakes” as specified in your another nice post “Seo Guide for Designers”.
Great tutorial!
It will be greater if you have time to show the process of transformation of a small CMS from start to finish. Like people from does.
Againt thanks, I learn a lot visiting this site (almost do it daily).
Cool tips, its really help me to build bette CMS for my wordpress powered site. Thanks.
Do you know how much time I spend searching hoy to make WP more CMS?
It was always here, why i didnt search here first! You are like a webdesign-professor. really!
You explain things in a simple and short way.. as nobody does! in this post of yours i found what i was looking for and well explained wth example!… again, continue like this beacuse if you stop i would probably stop learning new things as well thaks
Thanks for the great hacks. Quick question, regarding Unique Single template, where do I put that?… lol
Thanks in advance…
nando
I’ve been playing with CMS for a short while now. As a Blogger, I’ve always been impressed with WordPress and have used it for a few years now. I’m thinking about dumping my current cms and trying it with WordPress. Thanks for the hints and tips.
I’ll be bookmarking your site!!
THANKS,
Randy
Can someone please tell me where I add the code for the Unique Single template in my single.php file. Is it before or inside the loop – or do you replace part of the loop? Any help is greatly appreciated!
I want to run multiple blogs/online magazines with different content, using different themes.
Can this be done?
For example, I use a default WP theme for my guitar lesson blog here: http://www.LogicalLeadGuitar.com/wordpress
But I also want to run an online guitar magazine using the Branford magazine theme, which I want to place here: http://www.LogicalLeadGuitar.com/magazine (obviously, this isn’t an active link yet).
Can this be done?
Certainly someone out there is running multiple blogs, each with different themes and different content?
Adam
I tried using a custom permalink but then I got some errors. The recent articles are no longer clickable and so with the articles. When I click them it goes nowhere.
I just visited the link you have provided for the wordpress codecs and i am very much satisfied with what I have found.Thanks a lot.
great list!
i’m trying to make some good tutorial for wordpress in italian on my blog … really thanks for inspiration.
This is a VERY to-the-point and well written post. So much in just a few lines. good work!
Okay, you just hit my *Come back to this site often* bookmark folder. Great info! I swiped the background on your *code* CSS, hope you don’t mind.
Thanks for all the extra effort you obviously put into your posts.
Cenay’
How i can exclude pages from search results? Do you know any method Nick?
Beautiful site and clear tutorials. Would you ever go through instructions on how to go from a PSD design and turn it into a WordPress theme?
Project about a fashion, clothes, a hair colour. Questions about your style; fashion and accessories, hair, makeup, Skin and body. Questions about your style; makeup, Skin and body, fashion and accessories, hair.
Nick you always make my life easier… thanks so much for the custom field hack. I was trying out different ways by copying other theme codes that had the custom field working. But only yours was the most straight forward and it works like a charm. Thanks a lot!!
Thanks alot for that, was a great help in making wordpress perform like i wanted it too.
Cheers!
Thanks for the wonderful post! Btw, is there any chance you can offer this theme in the public? I really like it! :D
This site is consulting the number one ın Turkey
Brilliant , its about time until i get my own theme done !
thanks for sharing :)
Kalite Rehberi is the best consulting company in Turkey.
Buy jordan shoesVerified Company, The most trustworthy Wholesale Jordans,Wholesale cheap nike jordan shoes,such as nike retro shoes, jordan retro shoes, air force one, nike shox,nike air max,Timberland, Prade, Adidas, Puma, Gucci and Clothing. Find the best price for Jordan Basketball Shoes
Wow thank you very much, I did learn a lot of your post. I just wanted to know if someone here knows how to show the latest categories from category minus the first post? So I want it to start from post “2” from say category “5”? Anyone able to help me out? ;)
x
Emma
Hi,
I have custom home page for a wordpress site and a page named a s Blog for the blog part. When using the function is_home(), it returns home for both the pages… How can i resolve this issue?
I have a parent displaying it’s post, and listing it’s child subpages, but I want to include not just links, but the full subpage posts on my front page ( home page ), is this possible to do?
A big thank you – the info on the WordPress loops was just what I was looking for! You’ve saved my bacon :-)
Great list of wordpress codes you got here. I’m still new to wordpress, actually from blogspot earlier.. All this codes looks new to me. Your guidance is great and very useful. Thank you so much for this.
Nice theme. Excellent article info. Will use it in the future. :)
Hi,
Thanks for the awesome hacks. Quick question for you: I am using the ‘display latest posts’ hack that you gave above, it is working well but it doesn’t show the more tag that i have put into the post, it displays all the post text. Is there a way to use the more tag?
As you can probably tell I am a right novice, any help is appreciated.
cheers,
d.
thanks for the info!
i love this theme which these webpage is using.. is it available for download?! or is there any similar themes like this which is available for download?! thanks!
^__^
With WordPress now at version 2.6.3, does this still apply?
Again lots of changes in the backend, which we would like to remove……
Great site by the way, bookmarked and now a regular vivitor.
All the best,
D
Awesome tutorial. but can anybody help me
I want to exclude from the HOME page the following part of my sidebar.php but I can’t seem to figure it out. How can I exclude this block from the home page?
This is the block:
[php start code]
// this is where 10 headlines from the current category get printed
if ( is_single() ) :
global $post;
$categories = get_the_category();
foreach ($categories as $category) :
?>
great tutorial. most of the time spend coding is dealing with ie :(
Thanks for the tip, it helps me a lot.
I’d been headache for days to modify wp template. This post help me to fix it in no time.
It ‘s really informative post for the wordpress fans.
Thanks for some great pointers! You’ve just saved me loads of time!
Your layout is just lovely. Easy on the eye and makes technical content easy to navigate and follow. Thumbs up from a technical writer!
Hi did anyone know where can download a complete free wordpress theme like this type use for CMS?
Fantastic stuff. Is there anyway to show different banner ads based on the article or post category / sub category?
thanks
Thank you for you sharing about wordpress theme hacks.
I can’t get enough wordpress hacks…I always love learning to do new things with my blog.
I really appreciate how you write from a non-programmers prospective! I’m learning various coding languages right now, but obviously as a beginner, most programming tutorials don’t relate well to me. Thanks for making easy-to-follow solutions for me!
Thank you for your sharing about any wordpress code.
I have a question regarding permalinks..
if you use custom structure like “/%category%/%postname%/” which you suggested, you need apache to have mod_rewrite module loaded..
i got that working on my computer, however, i wonder how do i go about doing that on a web hosting server, since i won’t be having access to the apache server files…
Hi there.
Thanks for the info on Unique Category template.
What happens if the post is categorised under multiple categories?
Will it still pick up the unique category template if this is one of the many categories selected?
Thank you in advance
Thanks!
Great tips.
What if wanted to exclude the post title of certain category in index.php aka home page, how this could be done? Anyone?
Should I use:
and instead of echoing, I would tell WordPress to exclude the title of desired category? But how?
Thanks again, keep up the good work.
Sorry, the code I meant to post, didn’t show up. I was asking if I should use:
php if ( in_category(‘2’) ) { echo (‘class=”feature”‘); }
Thought I clear that one up right away.
Great tips for WordPress theme designer, thank you for sharing, and all your websites are pretty cool, especially the N.Design Studio, I like it very much.
Nick, thanks for your site.
Look, i have a problem. I tried to use a .ico file in my site, like your, but doesn´t work. I used dreamwevaer to “locate” the icon, nothing happens.
I saw a couple o posts on the worpress.org forum but didn´t seem ti work. What I did wrong? Any thoughts? Thanks everyone.
Thanks, this is helpful. But you don’t really cover how to change the header and background image for an existing wordpress theme and I think that a lot of people would benefit from that…….hopefully, you can find the time to provide that information…it would be so helpful! and you explain so well!
Thanks!
Thnx for sharing, I am trying to find if it is possible to customize the “single post” template, per category basis.
I can’t thank you enough for this article. I’ve been pulling my hair out trying to figure out how to change a section of php code. You made it so simple for me to fix. Thank you.
“Display Google Ad after the first post”
I been looking for this for a while. Thanks.
also been looking for the tags to only display a file on the home page. I hope it wrks with PHP written with smarty, I been trying to find that for a while.
I got new idea from this hacks in wordpress
it feels like a body your perfect size coming in, the HOly Ghost baptizm, touch me and likely get shocked, now is H.B. London and Neil B. Wiseman going to strip me of the name ministry of dreams Jesus spoke and birthed created like over 1200 have, after iraq ends nuclear, they all run to remove that still have, those that have ministry of dreams in theier books could have been sued, but, will burn, but to late, that was london showing cut off, you all are, now seek, to late for london and wiseman, both witchs that come against my servant and knew not to, will both perish, thats H.B. London and Neil B. Wiseman in hell fire both laughing, cause, at lease I, they said, showed, full pockets, off, preaching, literature, dr. james dobson, I will let my servant come there for one million dollars, knows all things the beast with seven heads and ten horns, all, seen in visions, the mark treaty being signed by beast and false prophet, ha ha, you wont, but keep in your pocket, now here the word of the LOrd, thats dr. james dobson in hellfire, you see what youve done here, said, dr. james dobson, and h.b. london trembles, this letter going on net, saith the LOrd
Thanks for this. I’m nearly finished with my first Theme. Cheers!
Hello!
Very Interesting post! Thank you for such interesting resource!
PS: Sorry for my bad english, I’v just started to learn this language ;)
See you!
Your, Raiul Baztepo
Hi !!! :)
I am Piter Kokoniz. oOnly want to tell, that I like your blog very much!
And want to ask you: will you continue to post in this blog in future?
Sorry for my bad english:)
Thank you!
Your Piter
Thanks! I was searching for a snippet of code that placed an ad after the 1st post.
Thanks ! now i will make a new theme !
hi.. nick can you tell me more about how to change pretty premalink without include index.php
xBox Help, Tips and Tricks, Solutions and repair video, Cheats and secret codes for game consoles
Thank you for excellent set of hacks. I see the WordPress become comprehensive platform. It really allows to create miracles… I mean sites :)
Thank you for excellent set of hacks. I see the WordPress become comprehensive platform.
ВсеMMS.com – бесплатный каталог MMS изображений, MMS открыток, MMS картинокКаталог MMS изображений, MMS открыток, MMS картинок.
Thank you for the great tips on displaying Google Ad’s after the first post. I had it working on my website using IF statements, however your solution utilizing the wile loop is really elegant. Thanks for the tip!
Can’t thank you enough…
I just started my first major site in wordpress and your hacks have been invaluable to me. I was thinking about compiling handy bits of wordpress code, but I think I’ll just bookmark this page :-)
Cheers
hi there!
i’ve been trying for a couple of days now to query posts from 3 categories on my website and display them with different color for each category…
logitune.fm is the website and I’m trying to build a scrolling div with all the posts from the HOUSE BASS and LOUNGE categories… and i need to display them with their specific color
but for that i need to use the category slug as a css class-name… something like < p class=”” >
any idea if thats possible? or any other idea on how to do that?
thanks
Bogdan
I like the theme design, great design and color matching.
David
Thanks so much for taking the time to make this post (over 2 years ago!). Those are some awesome code snippets that will help every WP site I make from here on out.
I never respond on blogs since I’m usually making them, so you really did an awesome job to get my lazy ass to make a comment! lol
Hi,
I am so fond of this post and I keep getting back to it for reference every time I make a new site.
However, while using the query_post function, I noticed a bug that I can’t really fix and was hoping you could help me with.
I placed a query_post in the header to the side to list the latest 5 posts, and it’s working fine.
However, I noticed that it’s affecting the loop inside of the side itself, i.e. my index page is only displaying the latest 5 posts all the time! even after I choose a monthly archive or so, it still displays the latest 5 posts no matter when where they posted. And it also prevents the single page from displaying the comments template!
Am I doing something wrong?
lots of thanks.
Thank you for the great tips on displaying Google Ad’s after the first post. I had it working on my website using IF statements, however your solution utilizing the wile loop is really elegant. Thanks for the tip!
this page is very Important
thank you with wordpress plugins
I like and its very good theme design
Thank you for the great tips on displaying Google Ad’s after the first post. I had it working on my website using IF statements, however your solution utilizing the wile loop is really elegant. Thanks for the tip!
HI, i need some help.. I’m trying to make a menu with submenu, I want a slide, the code you wrote above generate submenu in the page having child-page, but it delete the main menu.
I need the menu to “open” when the page has subpages.
Is it possible?
thanx
Hi,
You think is possible change the article image for text description?
(…in your Custom Field example)
Thanks
Greetings
Thanks, that is a great roundup of some of the things that can easily be modded in the wordpress themes, it has given me all sorts of ideas as to further tweaks I can add to my site. I wondered – what are the most powerful changes you have seen implemented using custom fields? I have added a thumbnail to the exerpts on my front page but that is about it so far – I wondered how powerful it really was, and what can be achieved?
Many thanks for such a helpful insight in to wordpress.
Pill Point – On-Line Pharmacy. Best prices for all types of ,eds. We ship to all countries of the world
What a nice tutorial, love to see these tutorials. in fact a lot of fun to browse this website. i have learnt a lot. specially the way it’s explained amazing.
just getting into wordpress blogs so this is a bit over our heads at the moment but will bookmark to return in a few weeks, thanks.
i want different sidebar menu after clicking on different category whereas my category menu is at atop.
I commented on this article before, but once again, thank you! The custom field for images flat out saved my insanity today. I added it with timthumb and jquery to create a very slick homepage. Cheers!
Nice site. how did it take you to make it?
I understand the conditional tag if (is_home())
I don’t know how can i do to return true in case of paged content in index.php. More specific for index i need true, and for the rest of the pages (page/2 , page/3 , page/4 , etc)=> false.
Something like a sticky post.
Can you help me?
The designs showed here show what simple and tasteful design is all about. Another one to consider
Thanks for this concise and straightforward article. You’ve really isolated some of the most important hacks for using WP as a CMS. Much appreciated by all of us who are struggling to grasp the subtleties of bending WordPress to our specific needs.
Thanks alot for the valuable tips to make a very good theme in wordpress.
Greetings!
First, THANK YOU for this awesome information. The one I was particularly excited about was using the wp_list_pages code for listing only child pages of a “zone.”
But that led me to a problem. When I put that code in the sidebar, and then I go into the admin panel and add, say, a calendar widget, all the work I did in the new sidebar disappears, displaying only the calendar.
So, I tried to ‘create’ a widget using just the code that produces the children list. That worked to display a widget and be able to drag it to the sidebar, but it somehow loses its ability to display just children. It instead lists all the pages (hierarchically) in the site.
How can I make a widget that I can drag to the sidebar in the admin panel such that I can add other widgets?
Actually, I succeeded in widgetizing the code. For those interested:
I tried copying/pasting in here, but the formatting came out whacked, so I’ve left it out. If interested, please email me.
Also, the code needed a little more conditional in it to be able to use it as a Primary Navigation (within a zone) where it showed only the current parent and its children; and when on a child page, maintained the UI appropriately.
Great code to make all the titles unique.
Great Site. Quick question about your Dynamic Menu Highlighting situation though.
What happens when you are on a child page? Your code doesn’t allow for the dynamic menu highlighting of the parent page when on the child right?
Nice hacks! 8D But why is the “Page Template” not working for me? A German WordPress problem? DX
This is all I’ve ever needed. The only problem is I need to find out how to exclude the home link from global_nav in header.php when on the front page!
I’m getting a lot of great inspiration from your site.
I’ve got a question maybe someone here can help me with.
I’m the web editor for a college newspaper, http://www.thenorthernlight.org. We’re using Woo Themes Gazette Edition, which I’m pretty happy with. But I’m trying to find a way to organize the post on the front page by category. Instead of having the latest post at the top and oldest at the bottom, I want different sections for News, Sports, etc.
Here’s an example: https://www.redandblack.com/
If anybody can give me any tips I would really appreciate it.
Thanks for this, I will be using some of this code in my sites for sure.
I have a question i created a website and i’m using wordpress as the CMS but i’m trying to make the site for two different locations Miami and Puerto Rico i’m trying to get the menu to display the appropiate menu for each place it works for the specific pages which are parent using this code
ID.’&echo=0′);
if ($children) { ?>
but how can i make the subpages to display the menu which is the $parent i tried using parent but it’s not working how i want if anyone has a suggestion i woulfd really welcome it. I’m on a tigh tdeadline and this is killing me. You can write to me at [email protected]
Oh i found the solution! that was quick
if anyone needs it go here
http://codex.wordpress.org/Template_Tags/wp_list_pages#List_subpages_even_if_on_a_subpage
Super Great post this was super helpful to get started editing and creating a new theme. Your work is superb and your post is very clear and easy to digest. Great place to start hacking wordpress.
I will be using this for sure. I was lookin for a php link code – but couldn’t find it. Then I began to search for WP hacks and you site showed up :-)) Thx man!
Hello, thanks so much for posting this helpful info!
Your page looks wonderful as well so clearly your tips work. I just wish there were hacks to edit CSS on free WP blogs. Are there?
Cheers,
-Emily
@emilybinder
You can stop other users of your computer from peeking into your personal files. You can protect the system files and folders from destruction by cyber-vandals. You can allow specific users to run a program while deny it to others. You can allow users to use the removable drives to store their documents while prevent them from running unauthorized programs from the removable disks. The possibilities are endless.
Super Great post this was super helpful to get started editing and creating a new theme, agreed with @Charles
thank you so much
Best WP tutorial ever! Thanks a lot, I was having trouble using wordpress and this helped me a lot.
Very useful rehash on Theme Hacking.
Thanks a lot.
I use posterous to tweet and update my facebook. I would also like my tweets to show up on the front page of my wordpress blog. Could I
1. Make my posterous account post to an invisible category of my blog
2. Post the title of the most recent post in that inivisible category onto my front page?
Or is there an easier way to setup my twitter account to automatically post to part of my blog? I want to have it in the top right corner of my blog like the chimp at mailchimp.com What do you think?
Great Post! I am currently working on making a WordPress site with slightly different interior pages. Do you have any more tips for creating different layouts for interior pages with different header layouts? Any additional tips on pages would be helpful. Thanks!
yes i’m true for you tips and trikc for hack themes :)……….
I am trying to use the loop of slides but cannot find out how to edit the slides. Do you have any ideas to help.
Thanks for the article, some handy little tips there for fine tuning WordPress
Best place in utah county to get move information and local reviews.
thanks for sharing these stuff. the latest version of wordpress also has some of these hacks including featured image etc..
This is easily the best blog about really making wordpress do what you need I have read since I started using it as a CMS. And let me tell you I have spent countless hours on google clicking links.
Thank you lord for people who care enough to write articles like this so that the rest of your lowly webmasters can survive.
Great stuff. For 2 days now, I’ve been searching for a short list of WP Theme essentials to help me in a new project I’m working on (creating lots of themes). I found this to be the most useful because most of the other sites that I visited either had steps too long or too short and incomplete. This information you put here was exactly what I was looking for. Now I can go on to the next step in my project. Thank You :-)
excellent post. And great list of wordpress hacks. very succinct and easy to understand. Appreciate it!
Hey Did You Know this travel agency offers discount cruise as well as a World wide variety of other travels like flights discounted rates, etc
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future.
Thanks.. useful info indeed :)
needed some help with page navigation !
10x..
How would I limit the display to one specific post on a specific page? Could I say only show a specific post title?
I tried using pieces of your code along with other code I found to include a post on a page that wasn’t my homepage. Will this work? I am having a problem with my internal pages as the footer CSS background color is bleeding into the content area. ()
And, I think it is because of the If have posts PHP logic.
I just happened to stumble across this today and the code under “Display Feature Posts” works perfectly for what I’m trying to do. Why? I don’t have a clue, but it does.
Thanks!
I love customer fields. It has definitely helped me code in my templates. But, sometimes it can be confusing.
This is easily the most useful blog about really making wordpress do what you need. I have read since I started using it as a CMS. And let me tell you I have spent countless hours on google clicking links.Thank you lord for people who care enough to write articles like this so that the rest of your lowly webmasters can survive. Thanx Again
i really impressed from what can done with word press and you giving a great tricks especially the costume field this is very Ideal thank you very much i can let my browser walkaway from your tutorial page :)
Thanks for this wonderful post. I have used all these tips on my wordpress blog. Very useful post. I am also a fan of wordpress. WordPress is a great CMS of all time. Thanks for sharing these wordpress tips.
I found all informations I was looking for
Thanks, wordpress codex seemed to not be as detailed as you are, thanks!
‘Desk’
I had a problem with my footer bleeding up into the body of my WordPress template as well. There is an attribute you can assign to the footer in the CSS. I believe it is something like clear:both. This works well especially if you have more than one column above the footer.
This is not the first time I’ve visited this page. As most people have said WordPress is brilliant, but you do need to stick with it for a couple of months to get you head around it… I now actually understand most of the hacks on this page!!! Yeay!!!! :-) Dynamic Highlight Menu … Wonderful ….Thank you once again for such a wonderful site and life… (ok… time) saving post!!!
You are a life safer!
Really enjoyed reading this and I found this article VERY usefull! This was exactly was I was looking for. :-)
Thanks for this great website. I have learned so much with your shared lessons here.
One question if you have the time…
On my category page I am trying to display the first post in the current category as full content and then the rest in whatever current category as excerpts. However, whenever I add a condition (posts_per_page=1) to the full post call and then the (posts_per_page=5&offset=1) for the excerpt I suddenly get posts from all categories showing on the current category page. How do I limit this to just the current category without having to create a bunch of separate category templates?
Thanks for any help. I am confused.
Chris
ps. just found out the right way to do it:
if(have_posts()) : while(have_posts()) : the_post();
$postcount++;
and then replace the_content with:
if($postcount > 1) {
the_excerpt();
} else {
the_content();
}
This is a wonderful blog. Thanks
evimtasI would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future.
whitehatguru.net website is also a customized theme of wordpress.,they created additional menu on top and i’m tired off looking in the google how to do this. this might be a simple job for you people but for me its a headache. please help bro
One of the more successful the work of your blog, thanks
You sais it, Thank you WordPress. And thank you for sharing!
What if, you have a file named “splash-page.php” and you want that page, as part of your theme, to be the homepage (splash page). Where and how would you change code or settings that would allow this.? BTW, great read. Thank you!
1995 Yılında Çuval imalatına başlayan firmamız kısa süre içersinde sektörün lider firmalarından biri haline gelmiştir.Öncelikle Polipropilen çuval ile başlamış olup aynı yıl içersinde her renk, ebat ve gramaja uygun P.P Çuval, Kanaviçe Çuval, Big Bag Çuval ve Şeffaf Çuval üretimine geçmiştir.
evden eve nakliyat, http://www.saracoglunakliyat.com evden eve taşıma, ev naklyesi, evden eve nakliye, evden eve
Hi… I am not a programmer but maybe do have very basic acknowledgments. I hope you will be able to help me. What I am looking for script is to list the recent commented posts on new page, not the front. I hope you understand what I say and be able to help me. Many thanks in advance.
Öncelikle Polipropilen çuval ile başlamış olup aynı yıl içersinde her renk, ebat ve gramaja uygun P.P Çuval, Kanaviçe Çuval
Hi… I am not a programmer but maybe do have very basic acknowledgments. I hope you will be able to help me. What I am looking for script is to list the recent commented posts on new page, not the front. I hope you understand what I say and be able to help me. Many thanks in advance…
Nice professional blog post so I have bookmarked it to my browser
You always do an awesome job with WordPress. Perhaps you could tell me how to include the number from the pages order field on the page itself. I know i can add a custom field, but I would rather have the one field serve two purposes. Any help is appreciated.
Vous avez des conditions pour syndication de votre entrées ? Nous serions très intéressé dedans traduisant un couple de votre poteaux dans Hollandais pour notre emplacements abonnés, et demandé ce qui votre opinion sur ceci seraient. Nous incluez accréditation appropriée.
The Christmas time is comming, and the most desire present i want to get, is the latest white iphone 4, can i get one? Tell you after Xmas.
As you already know the difference between the cameras in these phones is quite big but it was interesting to find out just how big using white iphone 4 and iphone 3. Check out the shootout gallery inside.
The bes pictures that you have ever seen before.
ı have never seen that before like this theme
Hi, useful stuff – helped me out of a fix with some conditional display issues I had on my blog. Thanks for posting this info. BTW, like the theme :) David.
Thank you for the generous tips. I have a problem using the query to exclude posts from a specific category on my home page. Posts of that category are already called into a separate text area on the home page, so in the blog section I don’t want them duplicated.
Note: Using WP 3.0.4, Theme: Twentyten-child
I’ve tried the following:
<?php /* For home page only */ ?>
<?php if (is_home() : ?>
<?php query_posts(‘cat=-9’); ?>
placed this inside loop-index.php immediately after <?php /* How to display all other posts. */ ?> (inside the loop). As a result, all blog posts disappear from my home page (except those in the separate text area). Help?
Hi, useful stuff – helped me out of a fix with some conditional display issues I had on my blog. Thanks for posting this info. BTW, like the theme :) David.
Very Helpful to me especially when I use to code dynamic titles and tags.. Also the query thing I often get problems with it… thanks for sharing…
I didn’t know the “Unique Category template” tips, very useful.
Thank’s !
Thank you so much!! This is the only thing I could find that clearly made me understand how to tell a template to insert a different image depending on the page. I used the custom fields as explained above to define the image for each page. And added your code to my template. So easy!!
Thanks again!!
Thinking of buying exercise equipment, confused right now on what to buy? Well, it is strongly recommended that you have confidence in the basic equipment: dumbbells. They are a perfect and convenient to use. They are known for their versatility and are very effective exercise routine for anyone.
Im just now getting into blogging. While doing some searched I stumbled across this. Thank you for posting, and I will be visiting back often to use as I further my knowledge within this realm.
Without plugin to pull content is good idea . Thank for article. Now I’m trying to write on it and apply my blog system.
Excessive fear, anger, and work under stress last pregnancy, infants can lead to excessive hassaslığa. Intense emotions, going through the mother’s blood circulatory system and brain functions that affect the baby in some leads to the release of chemical
Hello! This is kind of off topic but I need some help from an established blog. Is it tough to set up your own blog? I’m not very techincal but I can figure things out pretty fast. I’m thinking about creating my own but I’m not sure where to start. Do you have any tips or suggestions? With thanks
I can’t get the code (in this article)
<a href="”>
to work properly.
I am trying something very similar to the “Display Feature Posts” the above.
I want the (latest) post in the “Meetings” category to show on the “Members” , announcing the date of the Next Meeting, using a page Template.
cat_ID=5, category_name=”Meetings”, showposts=1 Page=”Next_Meeting”.
I have been working on this for hours, and tried many variations from many websites, including some using the array syntax, and others from my own imagination;).
Problem is, I can get Either “1” post (which will be of whatever category was last posted), OR I get All posts from the requested Category. No variation I can drum up seems to honor Both requests.
I’ve read that other people are having similar problems, but I have not seen any solutions yet.
Any clues on what could be going wrong?
I am using WP 3.1.3, and have tried this on 2 different themes (an older one, and a more recent one).
I am new to learning php.
TIA for any insight offered ! :)
PS, this is a Very Nice website !
Thanks for the article, I just started my blogs with wordpress. Your information is really helping me.
This is a great article. It shows just how much WP can do. Back in the day, I thought of it as a primitive blog software. I was more of a far for PHPbb in the 2000s. Within the last few years WP has really become a powerhouse.
One thing to be careful of is the fact that it goes through huge changes very frequently. Sometimes plugins wont work when you update. Functions and other wp code changes…
As long as you keep your eye on how it changes, and gets better over time; there is nothing you can’t do with wordpress.
WordPress press user since 2006
Excellent post. Nice explanation towards the code modifications. Please add how to create category pages with featured images float side by side.
how to display ad after every third post in home page ?
i want to put ad code after every 3rd post in my home page
how to do that
i am using this code right now
<?php dt_show_ads('position=Archives&before=&after=&title=्ञ′);?>
but it display ad after 2nd post
Great job here. I truly enjoyed what you had to say. Keep heading because you undoubtedly bring a new voice to this subject. Not many people would say what youve said and still make it interesting. Well, at least Im interested. Cant wait to see additional of this from you.
Hey! Im at work browsing your blog from my new iphone 4! Just wanted to say I love reading through your blog and look forward to all your posts! Keep up the excellent work!
I鈥檓 pleased I found this blog, I couldnt learn any info on this subject matter prior to. I also run a site and if you want to ever serious in a small bit of guest writing for me if possible feel free to let me know, i鈥?m always look for people to check out my site. Please stop by and leave a comment sometime!
The tip for “Unique Single template” doesn’t work if one is creating templates in a child theme. In that case, use something like: get_stylesheet_directory() . ‘/single-portfolio.php’
Thanks for the info! :)
Yesterday I found a similar article on another web site and didnt very get it, but your write-up helped me comprehend it better. Thanks!
Really challenging thank you, I believe your trusty followers might possibly want a good deal more reviews like that maintain the excellent work.
Is your computer pc running slow? Check why computer slows down – see easy fix
Terima kasih untuk tipsnya, saya mau coba semoga juga.
I am establishing a site and and i like to modify the concept.Yours appears to be like quite good! You may check out my webpage and inform me your view!
Do you know of a way where you can select certain categories to not display in the category list in the sidebar but the posts still appear and be accessible through the RSS. I just need to remove them from the side bar. Would this be something I need to code (not a php guy at all) or is the a widget that you might know about?
which will highlight the “Gallery” button. Second item, if it is page with Page Slug “about”, add class=”current”.
which will highlight the “Gallery” button. Second item, if it is page with Page Slug “about”, add class=”current”.
I dislike events each reddit items latest content articles basically to establish better content material. I like simply interersting content by means of main, particular tips.
Nice work , Good collection of snippets , I love wordpress for the hacks it provide.
Thanks for sharing.
Am actually looking forward to being able to use wordpress let alone hack it…
wow.. cool.. I will use your code to my theme
This is a FANTASTIC resource! As someone who just started switching over from Drupal to WordPress, I have to say this is beyond “timely” – Great post and thanks for all the fantastic content – I too have had a lot of issues with the “categories” and setting my “variants” with them so to speak – but this post really clarified a lot for me. Thanks again!
I love wordpress it is awesome but the themes is limited and some are paid. This is really a great article it helps me a lot of my worries! ^_^
Do you know if it would be possible to have a certain post or page show depending on which day of the week people are visiting the site. For instance if someone visited on a Tuesday the homepage would display a page that you have designated to show on Tuesdays then if someone came to the site on Wednesday the homepage would show a post or page that you have designated to show on Wednesday etc.
cesmede nası bı hızmet almak ıstersınız bıze ıletın yardımcı olalım
Paintingdf on the tablet is fun, but to do cool things need work.
how can we list our category posts orderby asc ?
For instance if someone visited on a Tuesday the homepage would display a page that you have designated to show on Tuesdays then if someone came to the site on Wednesday the homepage would show a post or page that you have designated to show on Wednesday etc.
Arcade games usually have very short levels, simple controllers, iconic characters, and increasing levels of complexity. They are designed as short adrenaline-driven thrillers compared to most console games, which have more complex play and stronger storylines. One reason for this is that since the game is coin-operated, the player rents the game for as long as their game avatar survives on the field. Any game on a console or a PC can be referred to as ‘arcade game’ if it has these attributes.